package archer.framework.poi.command;

import archer.framework.core.constant.ConstantDescription;
import org.jxls.command.DefaultValueResolver;

/**
 * @author christ
 * @date 2016/7/12
 */
public class ConstantValueResolver extends DefaultValueResolver {

    public Object resolve(Object data, String prop) {
        if (prop.contains(":")) {
            String[] str = prop.split(":");
            Object value = super.resolve(data, str[0]);
            return ConstantDescription.getDescription(str[1], (String) value);
        }
        return super.resolve(data, prop);
    }
}
